<template>
  <div class="doctor-wrap">
    <nuxt-link :to="`/doctor/${datas.user_id}`">
      <div
        class="doctor-photo"
        :style="{background: `url('${datas.user_photo ? datas.user_photo : ''}') center center no-repeat`,backgroundSize:'cover'}"
      />
    </nuxt-link>
    <div class="doctor-content">
      <nuxt-link :to="`/doctor/${datas.user_id}`">
        <div
          class="doctor-content-wrap"
        >
          <div class="doctor-name">
            {{ datas.user_name }}
          </div>
          <div class="doctor-position">
            {{ datas.user_attributes.doctor_title }}
          </div>
          <div class="doctor-team-good-at">
            <div class="doctor-team-good-at-text">
              擅长：
            </div>
            <div
              v-if="datas.user_attributes.good_at.length"
              class="doctor-team-good-at-item"
            >
              {{ datas.user_attributes.good_at[0].name }}、<span v-if="datas.user_attributes.good_at[1]">{{ datas.user_attributes.good_at[1].name }} </span>
            </div>
          </div>
        </div>
      </nuxt-link>
      <div class="doctor-consultation" @click="consultation">
        免费咨询
      </div>
    </div>
  </div>
</template>
<script>
import Bus from '@/utils/Bus'
export default {
  components: {

  },
  props: {
    datas: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {

    }
  },
  computed: {

  },
  created() {
  },
  mounted() {

  },
  methods: {
    consultation() {
      Bus.$emit('open')
    }
  }
}
</script>
<style scoped lang="scss">
.doctor-wrap {
  display: flex;
  .doctor-photo {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    border: 1px solid rgba(237, 237, 237, 1);
  }
  .doctor-photo:hover {
    cursor: pointer;
  }
  .doctor-content {
    margin-left: 16px;
    .doctor-content-wrap:hover {
      cursor: pointer;
    }
    .doctor-name {
      height: 20px;
      font-size: 14px;
      font-weight: 500;
      color: rgba(51, 51, 51, 1);
      margin-bottom: 6px;
    }
    .doctor-position {
      height: 16px;
      font-size: 12px;
      color: rgba(153, 153, 153, 1);
      line-height: 16px;
      margin-bottom: 6px;
    }
    .doctor-team-good-at {
      width: 154px;
      height: 16px;
      font-size: 12px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 16px;
      margin: 0 auto 6px;
      display: flex;
      .doctor-team-good-at-text {
        white-space: nowrap;
      }
      .doctor-team-good-at-item {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
    .doctor-consultation:hover{
      cursor: pointer;
    }
    .doctor-consultation {
      width: 76px;
      height: 29px;
      font-size: 12px;
      font-weight: 600;
      color: rgba(80, 76, 255, 1);
      line-height: 17px;
      background: rgba(246, 246, 246, 1);
      border-radius: 15px;
      text-align: center;
      line-height: 29px;
      font-weight: 500;
    }
  }
}
</style>
